﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.Pages.Admission
{
    public partial class messages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((IQueryable<int>)Session["privilage"] != null)
            {
                var x = (IQueryable<int>)Session["privilage"];

                if (x.Contains(1009) == true)
                {
                    string redirectionScript = "<script language='javascript'>" + "function Delayer(){" + "setTimeout('Redirection()', 5000);" + "}" + "function Redirection(){" + "window.location = 'StudentSearch.aspx';" + "}" + "Delayer()" + "</script>";
                    Page.ClientScript.RegisterStartupScript(GetType(), "SetFocusScript", redirectionScript.ToString());
                }
                else
                    Response.Redirect("../organization/no_privelege.aspx");
            }
            else
                Response.Redirect("../organization/no_privelege.aspx");
        }
    }
}